<?php
include('admin.php');

set_page_info('id', 'users_comment');
set_page_info('title', 'Manage Users Comment');
get_header();
$uc = new items(array(
				'table'=>USERS_COMMENTS,
				'class'=>'usercomment',
				'order'=>'`uc_id` DESC' 
			));
?>
		<h2>Manage Users Comment</h2>
		<form action="mass-delete.php?type=users" method="post">
			<table  width="100%">
				<thead>
					<tr>
						<th width="10%"><input type="checkbox" /></th>
						<th width="30%">Name</th>
                        <th width="35%">Email</th>
                        <th width="10%">&nbsp;</th>
						<th width="15%">&nbsp;</th>
					</tr>
				</thead>
				<tfoot>
					<tr>
						<td colspan="5">
							<input type="submit" name="submit" class="button" value="Delete" />
                            Page: <?php echo $uc->pagination['page']; ?><?php if ($uc->needsPagination()) { echo ' &mdash; '; $uc->pagination(); } ?>
						</td>
					</tr>
				</tfoot>
				<tbody>
<?php
$result=mysql_query('Select * From '.USERS_COMMENTS.' Order by uc_status DESC') or die(mysql_error());
$num=mysql_num_rows($result);
if ($num>0) {
		while($r = mysql_fetch_array($result)){
		
?>
					<tr>
						<td class="checkbox"><input type="checkbox" name="mass_delete[]" value="<?php echo $r['uc_id'];  ?>" /></td>
						<td><?php echo $r['uc_name']; ?></td>
                        <td class="options"><?php echo $r['uc_email']; ?></td>
                        
						<td>
                        <a href="users_comment_detail.php?delete=<?php echo $r['uc_id']; ?>" title="Delete">
                        <img src="images/delete.png" alt="Delete" /></a>
							<?php 
							if($r['uc_status']==1) 
								echo '<a href="users_comment_detail.php?uc_id='.$r['uc_id'].'">UnApprove</a>'; 
							else echo '<a href="users_comment_detail.php?uc_id='.$r['uc_id'].'">Approve</a>'; 
							?>
                        </td>
                        <th><a href="users_comment_detail.php?detail=<?php echo $r['uc_id']; ?>" class="uc_detail">Detail >></a></th>
					</tr>
<?php
		}
}else{
?>
					<tr>
						<td colspan="5">No users found.</td>
					</tr>
<?php } ?>
				</tbody>
			</table>
            
		</form>

<script>
	$(document).ready(function(){
			$(".uc_detail").colorbox({width:"600", height:"400", iframe:true});
			
		});	


</script>
<?php
	get_footer();

?>